package com.lch.thread.blocking;

/**
 * @author: liuchenhui
 * @create: 2019-06-02 13:31
 **/
public class UserService {

    public void register() {
        User user = new User();
        user.setName("刘晨辉");
        user.setPhone("18271800469");
        add(user);
        sendMsg(user);
    }

    public void add(User user) {
        try {
            Thread.sleep(100L);
            System.out.println("add:" + user);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public void sendMsg(User user) {
        try {
            Thread.sleep(100L);
            System.out.println("sendMsg:" + user);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        UserService userService = new UserService();
        userService.register();
    }
}
